package SetBasicsAndBSTSet;

import java.util.ArrayList;

public class LinkedListSet<E> implements Set<E> {
    private LinkedList<E> list;

    public LinkedListSet(){
        list=new LinkedList<>();
    }
    //为链表添加第一个元素
    @Override
    public void add(E e) {
        if (list.contains(e)){
            list.addFirst(e);
        }
    }

    @Override
    public boolean contains(E e) {
        return list.contains(e);
    }

    @Override
    public void remove(E e) {
            list.removeElement(e);
    }

    @Override
    public int getSize() {
        return 0;
    }

    @Override
    public boolean isEmpty() {
        return false;
    }
}
